package com.mvc.cms.action.admin;

import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;


@Controller  
@RequestMapping("/fckeditor.do") 
public class FCKEditorAct {
	
	 /**
	  * 转入fck页面
	  * @param request
	  * @param modelMap
	  * @return
	  */
	 @RequestMapping(params = "method=go") 
     public String vgo(HttpServletRequest request,ModelMap modelMap){
    	
        String content = request.getParameter("txt");
        modelMap.put("content", content);
    	return "fckeditor/fckeditor";
     }
	 
    /**
    * fckeditor的使用
    * @param request
    * @param modelMap
    * @return
    */
    @RequestMapping(params = "method=select") 
    public String select(HttpServletRequest request,ModelMap modelMap){
    	
        String content = request.getParameter("txt");
        System.out.println(content);
        modelMap.put("content", content);
    	return "fckeditor/content";
    }
    
    /**
	  * 转入fck页面
	  * @param request
	  * @param modelMap
	  * @return
	  */
	 @RequestMapping(params = "method=image") 
    public String uploadImage(HttpServletRequest request,ModelMap modelMap){
       String content = request.getParameter("txt");
       System.out.println(content);
       modelMap.put("content", content);
   	return "fckeditor/imageUpload";
    }

}
